Repository navigation
refactor(ads-client): move a constructor onto its type and retire the common drawer - #7613
Conversation
261d5df to
b2bce14
Compare
|
At first being a method on the impl felt a bit odd because it was static and felt a little bit javaish, but since it is returning an optional instance out of it it does make more sense. It's kinda like a |
|
This makes sense to me. The 'ideal' place for such a mutable |
|
Sorry for the late response. That specific change came from the free-function rule. When a free function takes or returns a local type, the rule expects that function to live on the type, usually in an impl block. I agree this looks a lot like So the rule doesn't conflict with |
b2bce14 to
fae64f1
Compare
… and drop common Move pop_request_hash_from_url to RequestHash::pop_from_url, and move bytesize and clock out of common to the crate root. No behaviour change.
fae64f1 to
898055b
Compare
Two small refactors in
ads-client, no behaviour change.pop_request_hash_from_urlbuilt aRequestHashbut lived inmars::ad_response, which otherwise holds MARS wire types. It's nowRequestHash::pop_from_urlover inhttp_cache::request_hash, next to the type it builds, and its test moved with it. Both call sites are still commented out pending the Nimbus cache invalidation work, so theallow(dead_code)came across unchanged.commonheldbytesizeandclock: two unrelated modules under a name that says nothing about either. They're nowcrate::bytesizeandcrate::clock. Imports updated at 14 call sites, nothing inside either module touched.Independent of #7612, doesn't depend on it.
Pull Request checklist
crate::common::{bytesize, clock}becomescrate::{bytesize, clock}, but consumers use the uniffi API.fmtandclippy --all-targets -- -D warningsclean, 101 unit tests pass.